/*--------------------------------------------------------------------------------*/
#ifndef __GRAPHIC_ANIMATION_MANAGER__
#define __GRAPHIC_ANIMATION_MANAGER__
/*--------------------------------------------------------------------------------*/
#include "primitives.h"
#include "object.h"
#include "util.h"
#include "graphic_animation_data.h"
#include "map.h"
/*--------------------------------------------------------------------------------*/
#define GRAPHIC_ANIMATION_MANAGER_LoadFile 		GRAPHIC_ANIMATION_MANAGER::GetInstance().LoadFile
#define GRAPHIC_ANIMATION_MANAGER_GetAnimation	GRAPHIC_ANIMATION_MANAGER::GetInstance().GetAnimation
/*--------------------------------------------------------------------------------*/
class GRAPHIC_ANIMATION_MANAGER : public OBJECT
{

	// -- PUBLIC

public:

    DECLARE_REF( GRAPHIC_ANIMATION_MANAGER );
    DECLARE_SINGLETON( GRAPHIC_ANIMATION_MANAGER );

    // .. CONSTRUCTORS

    GRAPHIC_ANIMATION_MANAGER() : OBJECT(), AnimationTable()
    {

    }

    ~GRAPHIC_ANIMATION_MANAGER()
    {
    }

    // .. METHODS

    GRAPHIC_ANIMATION_DATA::REF & GetAnimation( const TEXT & animation_name )
    {
    	DEBUG_Require( AnimationTable.HasKey( animation_name ) );

    	return AnimationTable[ animation_name ];
    }

    VOID LoadFile( const TEXT & file_name );

    // -- PRIVATE

private :

    // .. METHODS

    VOID ParseFrames( GRAPHIC_ANIMATION_DATA & animation, const TEXT & frames_text );

    // .. ATTRIBUTES

    MAP< TEXT, GRAPHIC_ANIMATION_DATA::REF >
		AnimationTable;
    
};
/*--------------------------------------------------------------------------------*/
#endif
